//
//  CamerControlView.swift
//  UIImagePickerController
//
//  Created by 晨风 on 2019/7/3.
//  Copyright © 2019 levy. All rights reserved.
//

import UIKit

class CamerControlView: UIView {

    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */
    
    var PopButton = UIButton()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor.white.withAlphaComponent(0.3)
        
    }
    
    override func layoutSubviews() {
        self.PopButton.backgroundColor = UIColor.orange
        self.PopButton.translatesAutoresizingMaskIntoConstraints = false
        self.addSubview(self.PopButton)
        _ = self.PopButton.centerXAnchor.constraint(equalTo: self.centerXAnchor)
        _ = self.PopButton.topAnchor.constraint(equalTo: self.topAnchor)
        _ = self.PopButton.widthAnchor.constraint(equalToConstant: 120)
        _ = self.PopButton.heightAnchor.constraint(equalToConstant: self.frame.height)
        self.PopButton.addTarget(self, action: #selector(BtnClick), for: .touchUpInside)
    }
    
    @objc func BtnClick() {
        print("按钮点击了")
    }
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
